package com.icart.repositories;


import com.icart.entities.WoCommentEntity;
import org.springframework.context.annotation.Scope;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;

@Repository
@Scope("prototype")
public interface CommentRepository extends BaseRepository<WoCommentEntity,Integer> {
    @Transactional
    @Query(nativeQuery = true,value = "insert into wo_comment(commid,oid,custid,commstar,commcontent,createtime,isanonymous,isadd,readcnt,ispic) values(?1,?2,?3,?4,?5,?6,?7,?8,?9,?10) ")
    @Modifying(clearAutomatically = true)

    Integer insert(Long commid,String oid, Long custid, Integer commstar,String commcontent,Date createtime,Integer isanonymous,Integer isadd,Integer readcnt,Integer ispic);
}
